<template>
  <div class="completion-show">
    <div class="qHead">
      <span v-if="isNess" style="color:red">*</span>
      <span v-if="no!=0" class="font">{{no}}.</span>
      <span class="font">{{showtitle()}}</span>
    </div>
    <div>
      <br>
      <el-button resize="both" style="width: 300px;">点击获取地理位置信息</el-button>
    </div>
    <relationString :string="question.relationString"></relationString>
    <el-row>
      <question-pos-edit
          :questionnaire-id="questionnaireId"
          :questions="questions"
          :question-id="questionId"
          :question="question"
          type="completion"
          @edit="edit"
          @copy="copy"
          @deleteQ="deleteQ"
          @moveup="moveup"
          @movedown="movedown"
          @movetop="movetop"
          @movebottom="movebottom"
      >
      </question-pos-edit>
    </el-row>
  </div>
</template>

<script>
import QuestionPosEdit from '../QuestionPosEdit.vue'
import relationString from "../../../question/relationString";
export default {
  name:'Completion',
  components: {
    QuestionPosEdit,relationString
  },
  data(){
    return {
      ishover: true,
    }
  },
  props: {
    isNess: {
      type: Boolean,
      default: true,
    },
    no: {
      type: Number,
      default: 2,
    },
    title: {
      type: String,
      default: '标题'
    },
    questionId:{
      type:Number,
      default: 0
    },
    questionnaireId: {
      type: Number,
      default: 0
    },
    questions: {
      type: Array,
      default: []
    },
    question:{
      type: Object,
      default: null
    }
  },
  methods: {
    edit() {
      this.$emit('edit')
    },
    copy() {
      this.$emit('copy')
    },
    deleteQ() {
      this.$emit('deleteQ')
    },
    moveup() {
      this.$emit('moveup')
    },
    movedown() {
      this.$emit('movedown')
    },
    movetop() {
      this.$emit('movetop')
    },
    movebottom() {
      this.$emit('movebottom')
    },
    showtitle(){
      if(this.title == null || this.title == ''){
        return '题目'
      }else {
        return this.title
      }
    },
  }
}
</script>

<style scoped src='assets/css/editcss/completionShow.css'>
  /* @import url('../../css/completionShow.css'); */
</style>
